# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=netattack
pkgver=24.230b856
pkgrel=4
epoch=2
pkgdesc='Python script to scan and attack wireless networks.'
groups=('blackarch' 'blackarch-wireless')
arch=('any')
url='https://github.com/chrizator/netattack2'
license=('MIT')
depends=('python2' 'python2-argparse' 'python2-scapy' 'iw' 'wireless_tools')
makedepends=('git')
source=("$pkgname::git+https://github.com/chrizator/netattack2.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|bin/env python|bin/env python2|' netattack2.py
}

package() {
  cd $pkgname

  install -Dm 755 netattack2.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

